package com.youku.plugins.endcardV4New.view
{
   import flash.display.Sprite;
   import com.youku.interfaces.IEndCardV4New;
   import com.youku.plugins.endcardV4New.model.data.PlayerSizeData;
   import flash.display.Shape;
   import com.youku.plugins.PluginEventDispather;
   import com.youku.plugins.endcardV4New.model.data.PlayerVideoData;
   import com.youku.utils.DrawUtil;
   import flash.events.MouseEvent;
   
   public class Background extends Sprite implements IEndCardV4New
   {
      
      public function Background() {
         super();
      }
      
      private var _sizeData:PlayerSizeData;
      
      private var _bgColor:Shape;
      
      public function init(param1:Object = null, param2:PluginEventDispather = null, param3:PlayerSizeData = null) : void {
         this._sizeData = param3;
         var _loc4_:PlayerVideoData = param1 as PlayerVideoData;
         this._bgColor = DrawUtil.Rectangle(0,0,param3.width,param3.height,1118481,1,null,0);
         addChild(this._bgColor);
         this.addEventListener(MouseEvent.CLICK,this.onClick);
         this.changeSize(param3);
      }
      
      private function onClick(param1:MouseEvent) : void {
         stage.focus = null;
      }
      
      public function changeSize(param1:PlayerSizeData = null) : void {
         this._sizeData = param1;
         this._bgColor.width = param1.width;
         this._bgColor.height = param1.height;
      }
      
      public function uninstall() : void {
         this.removeEventListener(MouseEvent.CLICK,this.onClick);
         if(contains(this._bgColor))
         {
            removeChild(this._bgColor);
         }
      }
   }
}
